import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

aspect Loggy {
	
	static FileWriter fstream = null; 
    static BufferedWriter out = null; 
    int i = 0;
    public static void build() {	
    	try {
    		File f = new File("log.txt");
			fstream = new FileWriter(f);
				
			out = new BufferedWriter(fstream);
			
			loggit("Game Started");
		  
		} catch (IOException e) {
			e.printStackTrace();
		}
 	}
   
   public static void loggit(String str)
   {
	   try {
		   out.write(str);
		   out.newLine();
		   out.flush();
	   } catch (IOException e) {
			e.printStackTrace();
		}
   }
   
	after() returning: call(void *.play()) {
	//	loggit("Someone just made a move... ");
	}
	
	
	after() returning: call(Robot createRobot(int, int, String, String)) {
		loggit("Created robot...");
	}
	
	after() returning: call(void *.damage(int)) {
		loggit("Someone just got hit...");
	}	
	
	after() returning: call(* *.accelerate(int)) {
		loggit("Accelarating...");
	}
	
	after() returning: call(* *.turn(int)) {
		loggit("Turning...");
	}
	
	after() returning: call(* *.checkLife()) {
		loggit("Someone just died...");
	}

}
